<div class="outer-fill shadow padding15">
 <div class="judul-page">Our Products</div>
<form class="form-inline" role="form" method="post" action="<?php echo site_url($aksi_cari);?>">
    <div class="form-group">
      <label class="sr-only" for="pencarian">Pencarian</label>
      <input type="text" name="judul" class="form-control" value="<?php echo isset($param_judul)?$param_judul:''; ?>" id="judul" placeholder="Pencarian">
      <select name="jenis" class="form-control">
        <?php
          if($jenis == '0'){
            $p0 = "selected";
            $p1 = "";
            $p2 = "";
          }
          else if($jenis == '1'){
            $p0 = "";
            $p1 = "selected";
            $p2 = "";
          }else{
            $p0 = "";
            $p1 = "";
            $p2 = "selected";
          }
        ?>
        <option value="0" <?php echo $p0; ?>>All</option>
        <option value="1" <?php echo $p1; ?>>Portofolio</option>
        <option value="2" <?php echo $p2; ?>>Product</option>
      </select>
    </div>

    <button type="submit" class="btn btn-info btn-sm" id="cari" name="cari">
      <span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;Cari</button>
    <a href="<?php echo site_url('admin_portofolio/view_add')?>" class="btn btn-success btn-sm pull-right"> 
      <span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;Tambah
    </a>
  </form>
  <br>
  <!-- style table -->
  <table class="table table-striped">
    <thead>
      <tr>
        <th>No</th>
        <th>Judul</th>
        <th>Jenis</th>
        <th>Tgl Posting</th>
        <th>Aksi</th>
      </tr>
    </thead>
    <tbody>
    <?php 
    $no=1+$offset;
    foreach($hasil as $val){
    ?>
      <tr>
        <td><?php echo $no?></td>
        <td><?php echo $val['judul']?></td>
        <td>
          <?php 
            if($val['jenis'] == '1'){
              echo "Portofolio";
            }else{
              echo "Product";
            }
          ?>
        </td>
        <td><?php echo konvert_tgl($val['tgl_posting'])?></td>
        
        <td>
          <a href="<?php echo site_url('admin_portofolio/view_edit'."/".$val['id_portofolio']);?>" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span>&nbsp;Edit</a>
          <a onclick="return confirm('Apakah data ingin dihapus ?')" href="<?php echo site_url('admin_portofolio/delete'."/".$val['id_portofolio']);?>" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span>&nbsp;Hapus</a>
          
        </td>
      </tr>
    
      <?php
    $no++;
    }
    ?>
    </tbody>
  </table>
  <!-- end table -->
<?php
echo ! empty($pagination) ? '<center><div class="pagination">' . $pagination . '</div></center>' : '';
?>

</div>